/**
 * 按原型只有一个新建按钮
 */
import React, {Component} from 'react';
import {Button, Popconfirm} from 'antd';

const styles = {
  main: {
    margin: '1em 0',
    overflow: 'hidden'
  },
  bl: {
    float: 'left',
  },
  bv: {
    float: 'right'
  },
  select: {
    width: '10em'
  },
  rp: {
    display: 'inline-block',
    width: '200px',
    paddingLeft: '10px'
  },
  input: {
    width: '10em',
    margin: '0 1em'
  },
  but: {
    marginRight: '1em'
  },
  s: {
    marginTop: '1em',
    height: '28px'
  },
  viaBtn: {
    marginRight: '1em'
  },
  confirmB: {
    marginRight: '1em'
  }
};



class Filter extends Component {
  constructor(props, context) {
    super(props, context);
    this.state = {
      modalVisible: false,
      key: 'productName',
      keyWord: '',
      dateRange: []
    };
  }
  render() {
    const {isTesting,toggleTest,handlePass,reset} = this.props;
    return (
      <div style={styles.main}>
        <div style={styles.bl}>
          {/*<Button onClick={handlePass.bind(null,'',1)} type="primary" style={styles.viaBtn}>通过</Button>*/}
          {/*<Button onClick={handlePass.bind(null,'',0)} type="ghost">不通过</Button>*/}
          <Popconfirm
            title="确定批量通过吗？"
            onConfirm={handlePass.bind(null,'',1)}
            okText="确定"
            cancelText="取消"
          >
            <Button type="primary" className="cursor" style={styles.confirmB}>通过</Button>
          </Popconfirm>
            <Popconfirm
            title="确定批量不通过吗？"
            onConfirm={handlePass.bind(null,'',0)}
            okText="确定"
            cancelText="取消"
          >
            <Button type="ghost" className="cursor">不通过</Button>
          </Popconfirm>
        </div>
        <div style={styles.bv}>
          {
            !isTesting ? <Button
              type="primary"
              style={styles.but}
              onClick={toggleTest}
              className="search"
            >全部开始测试</Button>
              : <Button
              type="danger"
              style={styles.but}
              onClick={toggleTest}
              className="search"
            >全部结束测试</Button>
          }
          <Button onClick={reset} icon="sync">清空</Button>
        </div>
      </div>
    );
  }
}

export default Filter;
